home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mission 3
/
Mission 3.zip
/
Mission 3.iso
/
tools
/
facevalu
/
examples
/
soundgen
/
userwork.lst
< prev
Wrap
File List
|
1997-03-21
|
4KB
|
143 lines
> PROCEDURE user_rsc_var_init
'
current_menubar&=menu&
animate_background_alert!=TRUE
animate_sound_off!=FALSE
'
DIM sgvordef_arr$(6)
DIM sgton_arr$(12)
LET sgton_var&=0
LET sgoktave_var&=4
DIM sgoption_arr$(6)
DIM sgoption_arr!(6)
LET sgform_var&=3
LET sgdauer_var$="70"
DIM sgvordef_ton&(6)
DIM sgvordef_oktave&(6)
DIM sgvordef_options|(6)
DIM sgvordef_form&(6)
DIM sgvordef_dauer&(6)
'
RESTORE vordef
CLR sgvordef_ndx&
DO
READ sgvordef_arr$(sgvordef_ndx&)
EXIT IF sgvordef_arr$(sgvordef_ndx&)="***"
READ sgvordef_ton&(sgvordef_ndx&)
READ sgvordef_oktave&(sgvordef_ndx&)
READ sgvordef_options|(sgvordef_ndx&)
READ sgvordef_form&(sgvordef_ndx&)
READ sgvordef_dauer&(sgvordef_ndx&)
INC sgvordef_ndx&
LOOP
vordef:
DATA "Bell",9,7,&x000110,3,60
DATA "Helicopter",1,3,&x111001,8,8
DATA "Motorboat",1,2,&x111011,6,6
DATA "Alien",3,6,&x000111,8,90
DATA "***"
'
RESTORE ton
CLR sgton_ndx&
DO
READ sgton_arr$(sgton_ndx&)
EXIT IF sgton_arr$(sgton_ndx&)="***"
INC sgton_ndx&
LOOP
ton:
DATA C,Cis,D,Dis,E,F,Fis,G,Gis,H,b,"***"
'
RESTORE option
CLR sgoption_ndx&
DO
READ sgoption_arr$(sgoption_ndx&)
EXIT IF sgoption_arr$(sgoption_ndx&)="***"
READ sgoption_arr!(sgoption_ndx&)
INC sgoption_ndx&
LOOP
option:
DATA "PSG-soundchannel A",-1
DATA "PSG-soundchannel B",-1
DATA "PSG-soundchannel C",-1
DATA "rustle for A",0
DATA "rustle for B",0
DATA "rustle for C",0
DATA "***"
'
RETURN
> PROCEDURE user_rsc_interact(index&,tree&,object&,mc&,sub_me&)
'
' <index&> is the index of this window in window_array&(index&,x)
' If the object tree is the normal menu bar, <index&>=-1
' <tree&> is the object tree number
' <object&> is the object that was selected (clicked on OR shortcut)
' <mc&> is the number of clicks (1=normal/2=double clicked/1 if shortcut)
' <sub_me&> is the chosen menuitem in a popup menu
'
LOCAL set&,dauer&
'
SELECT tree&
'
' ------------------------------------------------------------------------
'
CASE menu&
SELECT object&
CASE mmabout&
~@alert_wind(1,alabout&,"")
CASE mmsoundg&
LET soundgen_window&=@win_open_dialog(2,soundgen&,-1)
CASE mmquit&
exit_program!=TRUE
ENDSELECT
'
' ------------------------------------------------------------------------
'
CASE soundgen&
SELECT object&
CASE sgvordef&
LET set&=@listbox_menu(index&,object&,sgvordef_ndx&,sgvordef_arr$())
IF set&=>0
LET sgton_var&=sgvordef_ton&(set&)
LET sgoktave_var&=sgvordef_oktave&(set&)
BYTE{V:sgoption_arr!(0)}=sgvordef_options|(set&)
LET sgform_var&=sgvordef_form&(set&)
LET sgdauer_var$=STR$(sgvordef_dauer&(set&))
@rsc_ob_reset(soundgen&,0)
ENDIF
CASE sgton&
LET sgton_var&=@listbox_radio(index&,object&,sgton_var&,sgton_ndx&,sgton_arr$())
CASE sgoktave&
CASE sgoption&
@listbox_list(index&,object&,sgoption_ndx&,sgoption_arr$(),sgoption_arr!())
CASE sgform&
CASE sgdauer&
CASE sgplay&
' Dur-Akkord spielen
SOUND 1,15,sgton_var&,sgoktave_var&
SOUND 2,15,ADD(sgton_var&,4),sgoktave_var&
SOUND 3,15,ADD(sgton_var&,7),sgoktave_var&
dauer&=ROUND((2-LOG10(101-VAL(sgdauer_var$)))*10000)
WAVE BYTE{V:sgoption_arr!(0)},7,sgform_var&+6,dauer&
CASE sgstop&
SOUND 1,0
SOUND 2,0
SOUND 3,0
WAVE 7,0
CASE sgok&
@win_close(soundgen_window&)
ENDSELECT
'
' ------------------------------------------------------------------------
'
CASE fvt_altr&
alert_result&=SUB(object&,7)
@win_close(@find_handle_from_tree(fvt_altr&))
'
' ------------------------------------------------------------------------
'
' WRINKLES:
'
'
ENDSELECT
RETURN